package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.WarehouseDO;
import xcmg.device.dao.entity.warehouse.WarehouseDealerAuthDO;
import xcmg.device.service.vo.warehouse.WarehouseDealerAuthVO;

import java.util.List;

/**
 * 库存管理客户授权mapper类
 * @Author huhuawei
 */
@Mapper
public interface WarehouseDealerAuthDOMapper {

    /**
     * 根据客户ID和授权客户ID删除数据
     * @param dealerId
     * @param dealerAuthId
     * @param supplierId
     * @return
     */
    int deleteByDealerInfo(@Param("dealerId") String dealerId,@Param("dealerAuthId") String dealerAuthId,
                           @Param("supplierId") String supplierId);

    /**
     * 插入客户授权信息
     * @param record
     * @return
     */
    int insert(WarehouseDealerAuthVO record);

    /**
     * 根据供应商ID，客户ID
     * 查询客户授权信息LIST
     * @param record
     * @return
     */
    List<WarehouseDealerAuthDO> list(WarehouseDealerAuthVO record);

    /**
     * 根据客户ID和授权客户ID、
     * 查询当前对应的信息是否已存在
     * @param dealerId
     * @param dealerAuthId
     * @param  supplierId
     * @return
     */
    int countByDealerId(@Param("dealerId") String dealerId,@Param("dealerAuthId") String dealerAuthId,
                        @Param("supplierId") String supplierId);
}
